import { optimizeCb } from '../util/iteratee'
/**
 * 调用给定的迭代函数n次,每一次调用iteratee传递index参数。生成一个返回值的数组。z
*/
export default function times(n: number, iteratee?: Function, context?: any) {
  var accum = Array(Math.max(0, n))
  iteratee = optimizeCb(iteratee, context, 1);
  for (var i = 0; i < n; i++)accum[i] = iteratee(i);
  return accum;
}